package net.zbus.rpc;

import net.zbus.ClientPool;
import net.zbus.ClientPoolConfig;
import net.zbus.ZBusException;

public class RpcClient {

	public static void main(String[] args) throws Exception {
		ClientPoolConfig config = new ClientPoolConfig();
		config.setHost("127.0.0.1");
		config.setPort(15555);

		ClientPool pool = new ClientPool(config);

		Rpc rpc = new Rpc(pool, "MyRpc");   
		try{
			rpc.module("ServiceInterface");
			int res = rpc.invoke("plus", 1, 2); 
			System.out.println(res); 
		} catch (ZBusException e) { 
			e.printStackTrace();
		}
		
		pool.destroy();
	}
}
